<?php if ($type == 0): ?>
<?php $c=0; foreach ($jobs as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?>
		</div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-status"><?php echo (($job->cancel == 1) ? "Cancel request" : constant("JOB_STATUS_". $job->status)); ?></div>
		<div class="job-price"><?php echo (($job->price > 0) ? $this->Jobs->formatPrice($job->price) : "&ndash;");?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
<?php elseif ($type == 5): ?>
<?php $c=0; foreach ($jobs as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?>
		</div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-status"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
<?php elseif ($type == 6): ?>
<?php $c=0; foreach ($jobs as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?>
			<?php echo nl2br($this->Jobs->elapsed_date($job)); ?>
		</div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-status"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-price"><?php echo $job->create_date;?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
<?php elseif ($type == 2): ?>
<?php $c=0; foreach ($overdue as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } else { echo " job-red"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?></div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-date"><?php echo date('d M Y', strtotime($job->duedate)); ?></div>
		<div class="job-price"><?php echo $this->Jobs->formatPrice($job->price); ?></div>
		<div class="job-paid"><?php echo $this->Jobs->formatPrice($job->paid); ?></div>
		<div class="job-left"><?php echo $this->Jobs->formatPrice($job->price-$job->paid); ?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>

<?php
/** phpnew comment this block

<?php $c=0; foreach ($due as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?></div>
		<div class="job-date"><?php echo date('d M Y', strtotime($job->duedate)); ?></div>
		<div class="job-price"><?php echo $this->Jobs->formatPrice($job->price); ?></div>
		<div class="job-paid"><?php echo $this->Jobs->formatPrice($job->paid); ?></div>
		<div class="job-left"><?php echo $this->Jobs->formatPrice($job->price-$job->paid); ?></div>
		<div class="job-action"><?php echo $this->Jobs->showAdminActionLinks($job, "due"); ?></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
 * 
 * 
 */
?>

<?php elseif ($type == 3): ?>
<?php $c=0; foreach ($jobs as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); if ($job->madmin == 1) { echo "  job-orange"; } ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?>
		</div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-date"><?php echo $job->date; ?></div>
		<div class="job-price"><?php echo (($job->price > 0) ? $this->Jobs->formatPrice($job->price) : "&ndash;");?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
<?php elseif ($type == 4): ?>
<?php $c=0; foreach ($jobs as $jobOrder):
	$job = $jobOrder['order'];
	$routes = $jobOrder['routes'];
	$juinfo = $jobOrder['userinfo'];
?>
<div class="wrapper-world job-<?php echo (($c%2 == 0) ? "odd" : "even"); ?>">
	<div class="wrapper">
		<div class="job-id"><a href="joborder/<?php echo (substr($this->Jobs->getID($job),10,3)); ?>"><?php echo $this->Jobs->getID($job); ?></a></div>
		<div class="job-details">
			<?php $c1 = 0; foreach ($routes as $route): ?>
				<?php if ($c1 > 0): ?><br /><?php else: $c1++; endif; ?>
				<?php echo nl2br($this->Jobs->formatJobInfo($route)); ?>
			<?php endforeach; ?>
		</div>
		<div class="job-user"><?php echo htmlspecialchars($juinfo->name); ?></div>
		<div class="job-status"><?php echo constant("JOB_STATUS_". $job->status); ?></div>
		<div class="job-price"><?php echo (($job->price > 0) ? $this->Jobs->formatPrice($job->price) : "&ndash;");?></div>
		<div class="job-action"><input type="radio" value="<?php echo $this->Jobs->getID($job); ?>"  name="group1"></div>
		<div class="clr"></div>
	</div>
</div>
<?php $c++; endforeach; ?>
<?php endif; ?>